Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using original config to parse share links #4021

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

yiguous
Copy link
Collaborator

@yiguous yiguous commented Nov 17, 2024

Because Mr. R has appended new "extra" field to sharing protocol, it's time to use the original config of Xray-core when parsing share links.
This commit contains two modifications.

  1. append "Name" field to "OutboundDetourConfig".
  2. support marshaling "Address".

Maybe we should make more changes in the future, but it is enough currently for VLESS sharing protocol.

@Fangliding
Copy link
Member

@yiguous
Copy link
Collaborator Author

yiguous commented Nov 17, 2024

If we just "Marshal" current conf.Config, "address" will be like the below.

"address": {
    "Address": "example.com"
}

or

"address": {
    "Address": [
        127,
        0,
        0,
        1
    ]
}

They are not same with document. I think they will make client developers confused.

@Fangliding
Copy link
Member

and the "name" ?

@yiguous
Copy link
Collaborator Author

yiguous commented Nov 17, 2024

"name" is used to store descriptive-text. Currently, there is no such field. If not, we must use other field to store it, like "sendThrough", this field will not be used in most cases when developing client. But I think it is better to append a new field "name".

@Fangliding
Copy link
Member

Fangliding commented Nov 17, 2024

No need to add it, config file can be freely added invalid fields, the core will ignore them

@yiguous
Copy link
Collaborator Author

yiguous commented Nov 17, 2024

I see. The first change has been reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants